﻿using System;
using System.Data;
using System.Configuration;
using System.Collections;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Web.UI.HtmlControls;

public partial class Users_FindPwd : System.Web.UI.Page, ICallbackEventHandler
{
    protected void Page_PreInit(object sender, EventArgs e)
    {
        Page.Theme = BLL.Common.GetWSThemes();
    }
    string result;
    private string _question;
    public string Question
    {
        set { _question = value; }
        get { return _question; }
    }
    public string UserCode = "";

    protected void Page_Load(object sender, EventArgs e)
    {
        Page.Title = BasePage.WebTitle;

        BLL.V_CUSTOMER_AUTO bll_auto = new BLL.V_CUSTOMER_AUTO();
        Model.V_CUSTOMER_AUTO model_auto = new Model.V_CUSTOMER_AUTO();

        model_auto = bll_auto.GetModel(HttpContext.Current.Request.QueryString["LogName"],0);
        if (model_auto != null)
        {
            Question = model_auto.VC_PWDQUESTION;
            UserCode = model_auto.VC_CODE;
        }
        else
        {
            Question = "";
            ScriptManager.RegisterStartupScript(this, this.GetType(), "", "alert('不存在此用户')", true);
        }
    }

    #region ICallbackEventHandler 成员

    string ICallbackEventHandler.GetCallbackResult()
    {
        return result;
    }

    void ICallbackEventHandler.RaiseCallbackEvent(string eventArgument)
    {
        string[] temp = eventArgument.Split('|');
        result = new BLL.V_CUSTOMER().FindPassword(UserCode, temp[1].ToString(), temp[2].ToString());
    }

    #endregion
}
